home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / flilib.zip / FLISRC.ZIP / FSAME.ASM < prev    next >
Assembly Source File  |  1989-11-10  |  394b  |  30 lines

  1. _TEXT    SEGMENT  BYTE PUBLIC 'CODE'
  2.  
  3.     ASSUME  CS: _TEXT 
  4.  
  5.     public _i86_wsame
  6.     ;i86_wsame(d, count)
  7.     ; find out how many (16 bit) words in a row are the same 
  8. _i86_wsame PROC far
  9.     push bp
  10.     mov bp,sp
  11.     push di
  12.     cld
  13.  
  14.     les di,[bp+4+2]
  15.     mov cx,[bp+8+2]
  16.     mov ax,es:[di]
  17.     inc cx
  18.     repe scasw
  19.  
  20.     mov ax,[bp+8+2]
  21.     sub ax,cx
  22.  
  23.     pop di
  24.     pop    bp
  25.     ret    
  26. _i86_wsame ENDP
  27.  
  28. _TEXT    ENDS
  29. END
  30.